/**
* @file
* @author renzhiqiang
* @date 2017-04-13
*/
<template>
  <div>
    <header id="header" class="mui-bar mui-bar-nav" style="position: fixed;">
      <!--<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" @tap='goBack'></a>-->
      <h1 class="mui-title">{{currentHeader.title}}</h1>
    </header>
    <div class="mui-content" style="padding-top: 70px;">
      <div class="bgImg"></div>
      <div class="cg" v-text="text"></div>
    </div>
  </div>
</template>
<script>
//  import store from '../login-store';
  import {FastClick} from 'fastclick';
  var lan = require('./../language.json');
  export default {
    components: {},
    data: function () {    // 组件的数据格式
      return {
        currentHeader: {
          title: 'Register'
        },
        text: 'Congratulations !',
        language: lan[window.lan]
      };
    },
    methods: {
    },
    route: {
      data: function () {
        var type = this.$route.params.type;
        switch (type) {
          case 'reset': {
            this.text = this.language.resetSucess;
            this.currentHeader.title = this.language.ResetPassword;
            break;
          }
          case 'forget': {
            this.text = this.language.resetSucess;
            this.currentHeader.title = this.language.ResetPassword;
            break;
          }
          case 'register': {
            this.text = this.language.Congratulations;
            this.currentHeader.title = this.language.Register;
            break;
          }
          case 'payReset': {
            this.text = this.language.paymentSucceeded;
            this.currentHeader.title = this.language.paymentPassword;
            break;
          }
          case 'edit': {
            this.text = this.language.Succeeded;
            this.currentHeader.title = this.language.EditProfile;
            break;
          }
          case 'login': {
            this.text = this.language.Succeeded;
            this.currentHeader.title = this.language.SI;
            break;
          }
        }
//        if (type != 'payReset') {
//          var self = this;
//          setTimeout(function () {
//            self.$router.go('/loginSucess?r=' + store.state.detailR || '');
//          }, 3000);
//        };
      }
    },
    created: function () {
      if (document.querySelector('head title')) {
        document.querySelector('head title').textContent = this.language.SIWTA;
      }
    },
    ready: function () {
      FastClick.attach(document.body);
    }
  };
</script>
